import request from '@/utils/request'

const prePath = '/mapping'

//获取所有菜单
export function mappingUserRole(data) {
  return request({
    url: prePath + '/user-role/batchUpdate',
    method: 'put',
    data,
  })
}

export function deleteMappingUserRole(data) {
  return request({
    url: prePath + '/user-role/delete',
    method: 'delete',
    data,
  })
}
export function batchUpdateByRole(data) {
  return request({
    url: prePath + '/user-role/batchUpdateByRole',
    method: 'put',
    data,
  })
}

export function deleteByRole(data) {
  return request({
    url: prePath + '/user-role/deleteByRole',
    method: 'delete',
    data,
  })
}

// 批量新增设备分类关系
export function batchInsertCategoryDevice(data) {
  return request({
    url: prePath + '/categoryDevice/batchInsert',
    method: 'post',
    data,
  })
}

// 批量删除设备分类关系
export function batchDeleteCategoryDevice(data) {
  return request({
    url: prePath + '/categoryDevice',
    method: 'delete',
    data,
  })
}

// 通过供应商id分页查询与设备绑定关系
export function getMappingSupplierDevicePage(params) {
  return request({
    url: prePath + '/mappingSupplierDevice/page',
    method: 'get',
    params,
  })
}

// 搜索供应商设备分页列表
export function searchSupplierDevicePage(params) {
  return request({
    url: prePath + '/mappingSupplierDevice/search',
    method: 'get',
    params,
  })
}

// 批量新增供应商与设备的关系
export function batchInsertMappingSupplierDevice(data) {
  return request({
    url: prePath + '/mappingSupplierDevice/batchInsert',
    method: 'post',
    data,
  })
}

// 批量删除供应商与设备的关系
export function batchDeleteMappingSupplierDevice(data) {
  return request({
    url: prePath + '/mappingSupplierDevice',
    method: 'delete',
    data,
  })
}

// 查询产品分类关系分页列表
export function searchMappingCategoryProduct(params) {
  return request({
    url: prePath + '/categoryProduct/page',
    method: 'get',
    params,
  })
}

// 批量新增产品分类关系
export function batchInsertMappingCategoryProduct(data) {
  return request({
    url: prePath + '/categoryProduct/batchInsert',
    method: 'post',
    data,
  })
}

// 批量删除产品分类关系
export function batchDeleteMappingCategoryProduct(data) {
  return request({
    url: prePath + '/categoryProduct',
    method: 'delete',
    data,
  })
}

// 禁止领用
export function ProhibitApplyProductAdd(data) {
  return request({
    url: prePath + '/ProhibitApplyProduct/add',
    method: 'post',
    data,
  })
}

// 开启领用
export function ProhibitApplyProductDelete(data) {
  return request({
    url: prePath + '/ProhibitApplyProduct/delete',
    method: 'post',
    data,
  })
}

// 资源模板关联打印模板
export function insertResourcesPrintTemplate(data) {
  return request({
    url: prePath + '/resourcesTemplate/batchInsert',
    method: 'post',
    data,
  })
}

export function fatchResourcesPrintTemplate(params) {
  return request({
    url: prePath + '/resourcesTemplate/all',
    method: 'get',
    params,
  })
}
//寄售消耗确认表关系
export function getConsignOrderAll(params) {
  return request({
    url: prePath + '/consignOrder/all',
    method: 'get',
    params,
  })
}
//跟台记录表关系
export function getMainRelationOrderAll(params) {
  return request({
    url: prePath + '/mainRelationOrder/all',
    method: 'get',
    params,
  })
}
// 批量删除角色人员
export function batchDeleteUserByRole(data) {
  return request({
    url: prePath + '/user-role/batchDeleteUserByRole',
    method: 'delete',
    data,
  })
}

//增加打印次数
export function updatePrintCount(data) {
  return request({
    url: prePath + '/mappingOrderPrintCount/updatePrintCount',
    method: 'put',
    data,
  })
}
//HIS扣费手动处理保存
export function mappingHisSpdDeductConsumeConfirm(data) {
  return request({
    url: prePath + '/mappingHisSpdDeductConsume/confirm',
    method: 'post',
    data,
  })
}
//HIS退费手动处理保存
export function mappingHisSpdReturnDeductConfirm(data) {
  return request({
    url: prePath + '/mappingHisSpdReturnDeduct/confirm',
    method: 'post',
    data,
  })
}
